const Data=require('yg-Data');
const Main=require('yg-Main')

cc.Class({
    extends: cc.Component,

    properties: {
        goldCoinLabel:cc.Label,
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
        this.goldCoinLabel.string=Data.goldCoin;
        //测试方向控制器代码
        // cc.resources.load('game/direction', cc.Prefab, (err, prefab) => {
        //     let role=cc.instantiate(prefab);
        //     this.node.addChild(role);
        //     role.on('change',(direction)=>{console.log(direction)});
        // });
        // cc.resources.load('game/buttons', cc.Prefab, (err, prefab) => {
        //     let role=cc.instantiate(prefab);
        //     this.node.addChild(role);
        //     role.on('click',(button)=>{console.log(button)});
        // });
        //下面为测试角色的代码
        // cc.resources.load('roles/3/index', cc.Prefab, (err, prefab) => {
        //     let role=cc.instantiate(prefab);
        //     this.node.addChild(role);
        //     let roleJs=role.getComponent(require('game-role'));
        //     setTimeout(()=>{
        //         roleJs.pao(1);
        //     },600)
            
            
        //     // let armatureDisplay=role.getChildByName('animation').getComponent(dragonBones.ArmatureDisplay);
        //     // //console.log(armature);
        //     // armatureDisplay.armatureName='pao';
        //     // armatureDisplay.playAnimation('pao',0)
        //});
    },
    //快速加入按钮
    quickJoin(){
        Main.gameLoadding();
    },
    showCreateRoom(){
        cc.resources.load('lobby/创建房间', cc.Prefab, (err, prefab) => {
            this.node.addChild(cc.instantiate(prefab));
        });
    }
    // update (dt) {},
});
